﻿<%@ Page Title="Settings &raquo; ResourceBlender" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Settings.aspx.cs" Inherits="Settings" %>

<asp:Content ID="contentHead" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="contentMain" ContentPlaceHolderID="cntMain" Runat="Server">
    <h1>Settings</h1>
    <asp:Panel ID="pnlError" runat="server" CssClass="errorDiv">
        <h2>Error</h2>
        <asp:Label ID="lblError" runat="server"></asp:Label>
    </asp:Panel>
    <div class="niceform">
        <fieldset>
            <legend>Database</legend>
            <div class="formrow block">
                <asp:Label ID="lblDBMode" runat="server" AssociatedControlID="radDBMode" 
                    Text="Database Type"></asp:Label>
                <asp:RadioButtonList ID="radDBMode" runat="server" CssClass="checks"
                    OnSelectedIndexChanged="radDBMode_SelectedIndexChanged" AutoPostBack="True">
                </asp:RadioButtonList>
                <asp:RequiredFieldValidator ID="vldDBMode" runat="server" 
                    ControlToValidate="radDBMode" Display="Dynamic" 
                    ErrorMessage="Database type must be specified" 
                    CssClass="validationerror block"></asp:RequiredFieldValidator>
            </div>
            <div class="formrow block">
                <asp:Label ID="lblDBHost" runat="server" AssociatedControlID="txtDBHost" 
                    Text="Host"></asp:Label>
                <asp:TextBox ID="txtDBHost" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="vldDBHost" runat="server" 
                    ControlToValidate="txtDBHost" Display="Dynamic" 
                    ErrorMessage="You must enter the database hostname" 
                    CssClass="validationerror block"></asp:RequiredFieldValidator>
            </div>
            <div class="formrow block">
                <asp:Label ID="lblDBPort" runat="server" AssociatedControlID="txtDBPort" 
                    Text="Port"></asp:Label>
                <asp:TextBox ID="txtDBPort" runat="server"></asp:TextBox>
                <asp:RegularExpressionValidator ID="vldDBPort" runat="server" 
                    ErrorMessage="You must enter the database port" ControlToValidate="txtDBPort"
                    CssClass="validationerror block" ValidationExpression="\d+" 
                    SetFocusOnError="True" Display="Dynamic"></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ErrorMessage="You must enter the database port" ControlToValidate="txtDBPort"
                    CssClass="validationerror block"
                    SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator>
            </div>
            <div class="formrow block">
                <asp:Label ID="lblDBUser" runat="server" AssociatedControlID="txtDBUser" 
                    Text="Username"></asp:Label>
                <asp:TextBox ID="txtDBUser" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="vldDBUser" runat="server" 
                    ControlToValidate="txtDBUser" Display="Dynamic" 
                    ErrorMessage="You must enter the database username" 
                    CssClass="validationerror block"></asp:RequiredFieldValidator>
            </div>
            <div class="formrow block">
                <asp:Label ID="lblDBPassword" runat="server" AssociatedControlID="txtDBPassword" 
                    Text="Password"></asp:Label>
                <asp:TextBox ID="txtDBPassword" runat="server" TextMode="Password"></asp:TextBox>
            </div>
            <div class="formrow block">
                <asp:Label ID="lblDBDatabase" runat="server" AssociatedControlID="txtDBDatabase" 
                    Text="Database Name"></asp:Label>
                <asp:TextBox ID="txtDBDatabase" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="vldDBDatabase" runat="server" 
                    ControlToValidate="txtDBDatabase" Display="Dynamic" 
                    ErrorMessage="You must enter the database name" 
                    CssClass="validationerror block"></asp:RequiredFieldValidator>
            </div>
        </fieldset>
        <div class="formrow block actions">
            <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="uniformbutton" 
                onclick="btnSave_Click" />
        </div>
    </div>
</asp:Content>

